package annimon;

import com.annimon.stream.Stream;

import java.util.Arrays;

/**
 * Created by kylin on 17-4-27.
 */
public class StreamDemo {
    public static void main(String[] args) {
        System.out.println(Stream.of(Arrays.asList(1, 2, 3, 4))
                .takeWhile(x -> x < 3)
                .toList());
        System.out.println(Stream.of(Arrays.asList(1, 2, 3, 4))
                .takeUntil(x -> x < 3)
                .toList());
    }
}
